﻿@{
    ViewBag.Title = "ASP.Net MVC 4 HTML Helper Sample";
    
}
<h2>@ViewBag.Title</h2>
<table>
    <tr>
        <td>
            Helper Name
        </td>
        <td>
            Helper Code
        </td>
        <td>
            Output
        </td>
    </tr>
    <tr>
        <td>
            TextBox
        </td>
        <td>
            @@Html.TextBox("Textbox1", "val")
        </td>
        <td>
            @Html.TextBox("Textbox1", "val")
        </td>
    </tr>
    <tr>
        <td>
            TextArea
        </td>
        <td>
            @@Html.TextArea("Textarea1", "val", 5, 15, null)
        </td>
        <td>
            @Html.TextArea("Textarea1", "val", 5, 15, null)
        </td>
    </tr>
    <tr>
        <td>
            Password
        </td>
        <td>
            @@Html.Password("Password1", "val")
        </td>
        <td>
            @Html.Password("Password1", "val")
        </td>
    </tr>
    <tr>
        <td>
            Hidden Field
        </td>
        <td>
            @@Html.Hidden("Hidden1", "val")
        </td>
        <td>
            @Html.Hidden("Hidden1", "val")
        </td>
    </tr>
    <tr>
        <td>
            CheckBox
        </td>
        <td>
            @@Html.CheckBox("Checkbox1", false)
            <br />
            @Html.Raw(@Html.Encode("<label>@Html.CheckBox(\"Checkbox1\", true) With Clickable Label</label>"))
        </td>
        <td>
            <label>@Html.CheckBox("Checkbox1", true) With Clickable Label</label>
            @Html.CheckBox("Checkbox2", false) Without Clickable Label
        </td>
    </tr>
    <tr>
        <td>
            Raw HTML
        </td>
        <td>
            @Html.Raw(@Html.Encode("@Html.Raw(@Html.Encode(\"<label>This is HTML TAG</label>\"))"))
        </td>
        <td>
            @Html.Raw(@Html.Encode("<label>This is HTML TAG</label>"))
        </td>
    </tr>
    <tr>
        <td>
            RadioButton
        </td>
        <td>
            @@Html.RadioButton("Radiobutton1", "val", true)
        </td>
        <td>
            @Html.RadioButton("Radiobutton1", "val", true)
            @Html.RadioButton("Radiobutton1", "val", false)
            @Html.RadioButton("Radiobutton1", "val", false)
        </td>
    </tr>
     <tr>
        <td>
            Drop-down 
        </td>
        <td>
            @@Html.DropDownList (“DropDownList1”, new SelectList(new [] {"Male", "Female"})) 
        </td>
        <td>
            @Html.DropDownList("DropDownList1", new SelectList(new [] {"Male", "Female"})) 
        </td>
    </tr>

    <tr>
        <td>
            ListBox 
        </td>
        <td>
            @@Html.ListBox(“ListBox1”, new MultiSelectList(new [] {"Cricket", "Chess"}))  
        </td>
        <td>
            @Html.ListBox("ListBox1", new MultiSelectList(new [] {"Cricket", "Chess"})) 
        </td>
    </tr>
</table>
